# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=leptosfmt
pkgver=0.1.18
pkgrel=0
pkgdesc="A formatter for the leptos view! macro"
url="https://github.com/bram209/leptosfmt"
# loongarch64: blocked by libc crate
arch="all !loongarch64"
license="MIT OR Apache-2.0"
makedepends="
	cargo
	cargo-auditable
"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/bram209/leptosfmt/archive/refs/tags/$pkgver.tar.gz"
options="net"

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm 755 target/release/leptosfmt "$pkgdir"/usr/bin/leptosfmt

	for l in -APACHE -MIT
	do
		install -Dm 644 LICENSE"$l" "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE"$l"
	done
}

sha512sums="
d060878e6c99899143ab8760fa15f618fc6cc99b06250a9c5feefceec64d8fba616c5f82e8533da52880a2f11e2e914c4eebd86b58948cb6ae4e0a4d17f6853a  leptosfmt-0.1.18.tar.gz
"
